﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;
using System.Globalization;
using System.Windows.Media;

namespace CommunicationDesktopApplication
{
    [ValueConversion(typeof(Guid), typeof(Boolean))]
    public class GuidToBoolean : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Guid appId = (Guid)value;
            if (appId == Guid.NewGuid())
                return true;
            else
                return DesktopServiceController.Instance.ApplicationId != appId;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return DependencyProperty.UnsetValue;
        }
    }
}
